
package com.amado.springboot.springbootmybatis.controll;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.amado.springboot.springbootmybatis.domain.User;
import com.amado.springboot.springbootmybatis.service.UserService;

/**
 * @author wangyl-910
 * @description
 * @date 2017/11/25
 * @see
 */
@Controller
@RequestMapping("/user")
public class UserControll {

	@Autowired
	private UserService userService;

	@ResponseBody
	@GetMapping("/{id}")
	public User getUser(@PathVariable("id") Long id) {
		System.out.println(id);
		return userService.getUser(id);
	}
}
